﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using StructureMap;
using MedicalCare.DbLayer.Adaptors;
using MedicalCare.Messages;

namespace MedicalCare.UserControls
{
    public partial class FileUploadControls : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnAddComment_Click(object sender, EventArgs e)
        {
            var scheduleAdaptor = ObjectFactory.GetInstance<IScheduleAdaptor>();
            //var scheduleId = int.Parse(hiddenScheduleId.Value);
            var scheduleId = 7;
            var comment = tbCommment.Text;
            if (!string.IsNullOrEmpty(comment))
            {
                var scheduleCommentMsg = new ScheduleCommentMessage()
                {
                    Comment = tbCommment.Text,
                    UserId = AppPage.CurrentUser.Id,
                    ScheduleId = scheduleId
                };
                scheduleAdaptor.UpdateComments(scheduleCommentMsg);

                //InitialComments(scheduleId);
            }
        }
    }
}